import Vue from 'vue'

import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // css 重置的现代替代方法

import Element from 'element-ui'
import './styles/element-variables.scss'

import '@/styles/index.scss' // 全局 css

import App from './App.vue'
import router from './router'
import store from './store'

import './icons' // icon
import './permission' // 权限控制
import './utils/error-log' // 错误日志

import * as filters from './filters' // 全局过滤器

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // 设置 element-ui 默认大小
})

// 注册全局实用程序过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
